/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/layout/index.vue'

const allContractsRouter = [
  {
    path: '/contracts',
    component: Layout,
    redirect: '/contracts',
    name: 'contracts',
    meta: {
      title: '合同管理',
      icon: 'Memo',
      roles: ['ROLE_MANAGER', 'ROLE_BUYER', 'ROLE_WORK'],
    },
    children: [
      {
        path: 'all',
        component: () => import('@/views/contractController/allContract/index.vue'),
        name: 'all',
        meta: {
          title: '合同信息',
          keepAlive: true,
          icon: 'ChatLineSquare',
          roles: ['ROLE_MANAGER', 'ROLE_BUYER', 'ROLE_WORK'],
        },
      },
      {
        path: 'list',
        component: () => import('@/views/contractController/contractCard/index.vue'),
        name: 'contract',
        hidden: true,
        meta: {
          title: '合同列表',
          keepAlive: true,
          icon: 'Memo',
          roles: ['ROLE_MANAGER', 'ROLE_WORK'],
        },
      },
      {
        path: 'info',
        component: () => import('@/views/contractController/contractHome/index.vue'),
        name: 'contractInfo',
        hidden: true,
        meta: {
          title: '合同详情',
          icon: 'MenuIcon',
          roles: ['ROLE_MANAGER', 'ROLE_WORK'],
        },
      },
      {
        path: 'money',
        component: () => import('@/views/contractController/contractMoney/index.vue'),
        name: 'contractMoney',
        meta: {
          title: '合同收付款',
          keepAlive: true,
          svg: 'money-menu',
          activePath: '/contracts/money',
          roles: ['ROLE_MANAGER', 'ROLE_WORK'],
        },
      },
      {
        path: 'del',
        component: () => import('@/views/contractController/delContract/index.vue'),
        name: 'del',
        meta: {
          title: '合同删除',
          keepAlive: true,
          icon: 'Delete',
          roles: ['ROLE_ADMIN'],
        },
      },
      {
        path: 'search',
        component: () => import('@/views/contractController/searchGoods/index.vue'),
        name: 'search',
        meta: {
          title: '采购内容查询',
          keepAlive: true,
          icon: 'Search',
          roles: ['ROLE_MANAGER', 'ROLE_BUYER'],
        },
      },
    ],
  },
]

export default allContractsRouter
